<meta charset="utf-8">
<?php
    session_start();
    include($_SERVER['DOCUMENT_ROOT']."ExiaStore/Model/Users/membre.php");
    include($_SERVER['DOCUMENT_ROOT']."ExiaStore/Controller/verificationSaisies.php");
    include_once($_SERVER['DOCUMENT_ROOT']."ExiaStore/Model/verificationBDD.php");
    include_once($_SERVER['DOCUMENT_ROOT']."ExiaStore/Model/BDD.php");
    
    if(verifSaisie() && !verificationLogin(new BDD(), $_POST['login'])){
        $membre = new membre();
        $membre->initNewUser();
        $_SESSION['login'] = $membre->getLogin();  
    }
    
    echo "<script> alert('Inscription réussie') </script>"; 
    header("Refresh: 0,URL=../Controller/index.php");

?>
